package login;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class ImagePanell extends JPanel {
	   private Image img;

	public ImagePanell(String img) {
	       this(new ImageIcon(img).getImage());
	       
	     }

	     public ImagePanell(Image img) {
	       this.img = img;
	       Dimension size = new Dimension(980, 530);
	      setPreferredSize(size);
	       setMinimumSize(size);
	       setMaximumSize(size);
	       setSize(size);
	       
	       setLayout(null);
	     }public static void main(String[] args) {
		       ImagePanell panel = new ImagePanell(new ImageIcon("C:\\Users\\acer\\workspace1\\EsameLDAlgoritmi\\src\\Images\\image-1.jpg").getImage());
               
		       JFrame frame = new JFrame();
		       frame.setTitle("LOGIN");
		       
		       frame.getContentPane().add(panel);
		       frame.pack();
		       frame.setVisible(true);
		       frame.setLocation(200,100);
} public void paintComponent(Graphics g) {
    g.drawImage(img, 0, 0, null);
  }
}
